package com.meida.module.user.provider.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.meida.common.mybatis.model.*;


import org.springframework.web.bind.annotation.RestController;
import com.meida.common.springmvc.base.BaseController;
import com.meida.module.user.client.entity.AppPosition;
import com.meida.module.user.provider.service.AppPositionService;

import java.util.Map;


/**
 * 职位控制器
 *
 * @author flyme
 * @date 2019-08-04
 */
@RestController
@Api(tags = "APP用户管理")
@RequestMapping("/position/")
public class AppPositionController extends BaseController<AppPositionService, AppPosition> {

    @ApiOperation(value = "职位-分页列表", notes = "职位分页列表 ")
    @GetMapping(value = "page")
    public ResultBody page(@ModelAttribute(value = "pageModel") PageModel pageModel) {
        return bizService.pageList(pageModel);
    }

    @ApiOperation(value = "职位-列表", notes = "职位列表 ")
    @GetMapping(value = "list")
    public ResultBody list(@ModelAttribute(value = "listModel") ListModel listModel) {
        return bizService.listEntityMap(listModel);
    }

    @ApiOperation(value = "职位-添加", notes = "添加职位")
    @PostMapping(value = "save")
    public ResultBody save(@ModelAttribute(value = "updateModel") SaveModel saveModel) {
        return bizService.add(saveModel);
    }

    @ApiOperation(value = "职位-更新", notes = "更新职位")
    @PostMapping(value = "update")
    public ResultBody update(@ModelAttribute(value = "updateModel") UpdateModel updateModel) {
        return bizService.edit(updateModel);
    }

    @ApiOperation(value = "职位-删除", notes = "删除职位")
    @PostMapping(value = "delete")
    public ResultBody delete(@ModelAttribute(value = "deleteModel") DeleteModel deleteModel) {
        return bizService.delete(deleteModel);
    }
    @ApiOperation(value = "-详情", notes = "详情")
    @GetMapping(value = "get")
    public ResultBody get(@RequestParam(required = false) Map params) {
        return bizService.get(params);
    }



}
